use std::collections::HashSet;

struct Solution {}

fn main() {}

impl Solution {
    pub fn minimum_sum(n: i32, k: i32) -> i32 {
        let mut num_set = HashSet::new();
        let mut num = 1;
        while num_set.len() < n as usize {
            if !num_set.contains(&(k - num)) {
                num_set.insert(num);
            }
            num += 1;
        }
        num_set.iter().sum()
    }
}